<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.3" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.3">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.3">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.3">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.3" color="#222">





  <meta name="keywords" content="xcode," />










<meta name="description" content="XcodeTool简介 这是一个Xcode的扩展工具，依赖于xcodebuild。目前已经实现了优化Xcode编译速度，跟一键打包功能  功能介绍工具界面如下2张图 工具目前有2部分功能，第一部分是优化Xcode开发编译速度，包括了清理本地Xcode生成的缓存文件，挂载RAM，修改Xcode线程数，优化Xcode项目的配置文件。可能有部分同学不太清楚什么是挂载RAM，这里我主要介绍下这块内容。由于">
<meta name="keywords" content="xcode">
<meta property="og:type" content="article">
<meta property="og:title" content="第二篇:XcodeTool ">
<meta property="og:url" content="http://yoursite.com/2019/01/03/第二篇-XcodeTool/index.html">
<meta property="og:site_name" content="简·Work">
<meta property="og:description" content="XcodeTool简介 这是一个Xcode的扩展工具，依赖于xcodebuild。目前已经实现了优化Xcode编译速度，跟一键打包功能  功能介绍工具界面如下2张图 工具目前有2部分功能，第一部分是优化Xcode开发编译速度，包括了清理本地Xcode生成的缓存文件，挂载RAM，修改Xcode线程数，优化Xcode项目的配置文件。可能有部分同学不太清楚什么是挂载RAM，这里我主要介绍下这块内容。由于">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://yoursite.com/img/界面1.png">
<meta property="og:image" content="http://yoursite.com/img/界面2.png">
<meta property="og:image" content="http://yoursite.com/img/icon.png">
<meta property="og:image" content="http://yoursite.com/img/iPhone.jpeg">
<meta property="og:image" content="http://yoursite.com/img/fir1.png">
<meta property="og:image" content="http://yoursite.com/img/fir2.png">
<meta property="og:updated_time" content="2019-05-09T07:23:03.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="第二篇:XcodeTool ">
<meta name="twitter:description" content="XcodeTool简介 这是一个Xcode的扩展工具，依赖于xcodebuild。目前已经实现了优化Xcode编译速度，跟一键打包功能  功能介绍工具界面如下2张图 工具目前有2部分功能，第一部分是优化Xcode开发编译速度，包括了清理本地Xcode生成的缓存文件，挂载RAM，修改Xcode线程数，优化Xcode项目的配置文件。可能有部分同学不太清楚什么是挂载RAM，这里我主要介绍下这块内容。由于">
<meta name="twitter:image" content="http://yoursite.com/img/界面1.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '5.1.3',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2019/01/03/第二篇-XcodeTool/"/>





  <title>第二篇:XcodeTool  | 简·Work</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">简·Work</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/01/03/第二篇-XcodeTool/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Z4Kong">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="简·Work">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">第二篇:XcodeTool </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-01-03T22:30:34+08:00">
                2019-01-03
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Tool-Series/" itemprop="url" rel="index">
                    <span itemprop="name">Tool Series</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="XcodeTool"><a href="#XcodeTool" class="headerlink" title="XcodeTool"></a>XcodeTool</h2><h3 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h3><blockquote>
<p>这是一个Xcode的扩展工具，依赖于xcodebuild。目前已经实现了优化Xcode编译速度，跟一键打包功能</p>
</blockquote>
<h3 id="功能介绍"><a href="#功能介绍" class="headerlink" title="功能介绍"></a>功能介绍</h3><p>工具界面如下2张图<br><img src="/img/界面1.png" alt="图1"><br><img src="/img/界面2.png" alt="图2"></p>
<p>工具目前有2部分功能，第一部分是优化Xcode开发编译速度，包括了清理本地Xcode生成的缓存文件，挂载RAM，修改Xcode线程数，优化Xcode项目的配置文件。<br>可能有部分同学不太清楚什么是挂载RAM，这里我主要介绍下这块内容。由于我入职的公司给我们配的电脑是机械硬盘，所以在读取硬盘的数据的时候会特别慢，故将Xcode本地的缓存文件挂载到RAM中，提高缓存的读写速度，实现这个功能不难，比较麻烦的是如何卸载磁盘。起初想采用弹出磁盘的方式把磁盘从Finder中弹出，但是发现不好实现。想其他办法，后面发现挂载RAM的时候会产生一个对应的进程，kill掉这个进程就可以把磁盘整个从内存中卸载掉（固态硬盘的同学可以忽略这个功能，后期使用中发现提高的速度还是相对有限，功能比较鸡肋，磁盘空间不足的时候，Xcode编译会失败，如果跑多个项目基本要经常挂载卸载，相对麻烦）<br>所以针对Xcode编译优化主要是靠修改配置来实现，这块优化效果明显，而且是一劳永逸，不需要频繁的修改。</p>
<p>第二部分是实现了一个自动化打包，其实开源社区有一个功能非常全的自动化打包工具Fastlane。这个工具是用Ruby写的，Fastlane本身不具备打包、配置证书、上传的功能，它是实现了一个工具链，把这些工具给串联起来实现了自动化流程。Fastlane这种软件形式值得学习借鉴，可以实现工具的可插拔，易扩展。而且通过读Fastlane源码，我发现他编写每个Command的Option的时候也实现了可选的方式。相对于Fastlane而言，我这个工具的功能就比较单一了，只实现了打包、动态修改AppIcon、上传Fir、dSYM上传、打包邮件发送。比较有特色的可能就是给AppIcon加水印了，区分Debug模式和Release模式，方便QA同学识别。修改后的图片如下<br><img src="/img/icon.png" alt="图1"><br><img src="/img/iPhone.jpeg" width="30%"></p>
<p>后来发现Desktop Client智能给开发同学用，如果QA同学想自己打包就需要让开发同学弄，干脆就直接在工具内部写了一个服务器，通过http服务器的方式从工具内请求打包Web页面，页面如下图，需要打包的同学直接从浏览器发送打包请求，工具自动更新svn仓库代码，没有冲突的情况下自动打包，通过WebSocket的方式把输出结果推到Web Client。</p>
<p>第三部分由于排版没有想好怎么排布，所以一直没有动。未来可能加入一键导入Snippet、LinkMap分析等功能。</p>
<h3 id="Fir上的效果图"><a href="#Fir上的效果图" class="headerlink" title="Fir上的效果图"></a>Fir上的效果图</h3><p><img src="/img/fir1.png" alt="图1"><br><img src="/img/fir2.png" alt="图2"></p>
<h3 id="未实现功能"><a href="#未实现功能" class="headerlink" title="未实现功能"></a>未实现功能</h3><ul>
<li>ipa包自动下载安装</li>
<li>Android的打包</li>
<li>自动上传iTunes<br>···</li>
</ul>
<h3 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h3><blockquote>
<p>做这个工具的目的单纯是因为懒，从一开始的无界面版，到现在的算是满足基本使用，中间重写了不下3次，不断的把之前写的代码推翻，重新优化代码的结构，达到功能模块化，高复用的目的。工具还存在许许多多问题跟未实现的功能。实现的过程中学习到挺多东西。</p>
</blockquote>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/xcode/" rel="tag"># xcode</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/12/27/第一篇-UI作品集/" rel="next" title="第一篇:UI作品集">
                <i class="fa fa-chevron-left"></i> 第一篇:UI作品集
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2019/05/09/第三篇-Flutter基础之TabBar/" rel="prev" title="第三篇:Flutter基础之TabBar">
                第三篇:Flutter基础之TabBar <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zMjcwOC85MjY5"></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Z4Kong</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">4</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">4</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">4</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          <div class="links-of-author motion-element">
            
          </div>

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#XcodeTool"><span class="nav-number">1.</span> <span class="nav-text">XcodeTool</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#简介"><span class="nav-number">1.1.</span> <span class="nav-text">简介</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#功能介绍"><span class="nav-number">1.2.</span> <span class="nav-text">功能介绍</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Fir上的效果图"><span class="nav-number">1.3.</span> <span class="nav-text">Fir上的效果图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#未实现功能"><span class="nav-number">1.4.</span> <span class="nav-text">未实现功能</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#总结"><span class="nav-number">1.5.</span> <span class="nav-text">总结</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Z4Kong</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Mist</a> v5.1.3</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.3"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.3"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.3"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.3"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.3"></script>



  


  




	





  





  
 <!-- 来必力City版安装代码 -->
<div id="lv-container" data-id="city" data-uid="MTAyMC8zMjcwOC85MjY5">
	<script type="text/javascript">
   (function(d, s) {
       var j, e = d.getElementsByTagName(s)[0];

       if (typeof LivereTower === 'function') { return; }

       j = d.createElement(s);
       j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
       j.async = true;

       e.parentNode.insertBefore(j, e);
   })(document, 'script');
	</script>
<noscript> 为正常使用来必力评论功能请激活JavaScript</noscript>
</div>
<!-- City版安装代码已完成 -->
  












  





  

  

  

  
  

  

  

  

</body>
</html>
